<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - id:000977,sync:fuzzer2,src:001052.lcov_info_final - src/emitfromevents.cpp</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">src</a> - emitfromevents.cpp<span style="font-size: 80%;"> (source / <a href="emitfromevents.cpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">id:000977,sync:fuzzer2,src:001052.lcov_info_final</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">71</td>
            <td class="headerCovTableEntry">72</td>
            <td class="headerCovTableEntryHi">98.6 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2016-03-13 10:42:47</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">13</td>
            <td class="headerCovTableEntry">13</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #include &lt;cassert&gt;</a>
<span class="lineNum">       2 </span>            : #include &lt;sstream&gt;
<span class="lineNum">       3 </span>            : 
<span class="lineNum">       4 </span>            : #include &quot;yaml-cpp/emitfromevents.h&quot;
<span class="lineNum">       5 </span>            : #include &quot;yaml-cpp/emitter.h&quot;
<span class="lineNum">       6 </span>            : #include &quot;yaml-cpp/emittermanip.h&quot;
<span class="lineNum">       7 </span>            : #include &quot;yaml-cpp/null.h&quot;
<span class="lineNum">       8 </span>            : 
<span class="lineNum">       9 </span>            : namespace YAML {
<span class="lineNum">      10 </span>            : struct Mark;
<span class="lineNum">      11 </span>            : }  // namespace YAML
<a name="12"><span class="lineNum">      12 </span>            : </a>
<span class="lineNum">      13 </span>            : namespace {
<span class="lineNum">      14 </span><span class="lineCov">       3121 : std::string ToString(YAML::anchor_t anchor) {</span>
<span class="lineNum">      15 </span><span class="lineCov">       6242 :   std::stringstream stream;</span>
<span class="lineNum">      16 </span><span class="lineCov">       3121 :   stream &lt;&lt; anchor;</span>
<span class="lineNum">      17 </span><span class="lineCov">       6242 :   return stream.str();</span>
<span class="lineNum">      18 </span>            : }
<span class="lineNum">      19 </span>            : }
<a name="20"><span class="lineNum">      20 </span>            : </a>
<span class="lineNum">      21 </span>            : namespace YAML {
<a name="22"><span class="lineNum">      22 </span><span class="lineCov">       1081 : EmitFromEvents::EmitFromEvents(Emitter&amp; emitter) : m_emitter(emitter) {}</span></a>
<span class="lineNum">      23 </span>            : 
<a name="24"><span class="lineNum">      24 </span><span class="lineCov">       1081 : void EmitFromEvents::OnDocumentStart(const Mark&amp;) {}</span></a>
<span class="lineNum">      25 </span>            : 
<a name="26"><span class="lineNum">      26 </span><span class="lineCov">       1081 : void EmitFromEvents::OnDocumentEnd() {}</span></a>
<span class="lineNum">      27 </span>            : 
<span class="lineNum">      28 </span><span class="lineCov">      21598 : void EmitFromEvents::OnNull(const Mark&amp;, anchor_t anchor) {</span>
<span class="lineNum">      29 </span><span class="lineCov">      21598 :   BeginNode();</span>
<span class="lineNum">      30 </span><span class="lineCov">      21598 :   EmitProps(&quot;&quot;, anchor);</span>
<span class="lineNum">      31 </span><span class="lineCov">      21598 :   m_emitter &lt;&lt; Null;</span>
<a name="32"><span class="lineNum">      32 </span><span class="lineCov">      21598 : }</span></a>
<span class="lineNum">      33 </span>            : 
<span class="lineNum">      34 </span><span class="lineCov">       1990 : void EmitFromEvents::OnAlias(const Mark&amp;, anchor_t anchor) {</span>
<span class="lineNum">      35 </span><span class="lineCov">       1990 :   BeginNode();</span>
<span class="lineNum">      36 </span><span class="lineCov">       1990 :   m_emitter &lt;&lt; Alias(ToString(anchor));</span>
<a name="37"><span class="lineNum">      37 </span><span class="lineCov">       1990 : }</span></a>
<span class="lineNum">      38 </span>            : 
<span class="lineNum">      39 </span><span class="lineCov">      13697 : void EmitFromEvents::OnScalar(const Mark&amp;, const std::string&amp; tag,</span>
<span class="lineNum">      40 </span>            :                               anchor_t anchor, const std::string&amp; value) {
<span class="lineNum">      41 </span><span class="lineCov">      13697 :   BeginNode();</span>
<span class="lineNum">      42 </span><span class="lineCov">      13697 :   EmitProps(tag, anchor);</span>
<span class="lineNum">      43 </span><span class="lineCov">      13697 :   m_emitter &lt;&lt; value;</span>
<a name="44"><span class="lineNum">      44 </span><span class="lineCov">      13697 : }</span></a>
<span class="lineNum">      45 </span>            : 
<span class="lineNum">      46 </span><span class="lineCov">       6339 : void EmitFromEvents::OnSequenceStart(const Mark&amp;, const std::string&amp; tag,</span>
<span class="lineNum">      47 </span>            :                                      anchor_t anchor,
<span class="lineNum">      48 </span>            :                                      EmitterStyle::value style) {
<span class="lineNum">      49 </span><span class="lineCov">       6339 :   BeginNode();</span>
<span class="lineNum">      50 </span><span class="lineCov">       6339 :   EmitProps(tag, anchor);</span>
<span class="lineNum">      51 </span><span class="lineCov">       6339 :   switch (style) {</span>
<span class="lineNum">      52 </span>            :     case EmitterStyle::Block:
<span class="lineNum">      53 </span><span class="lineCov">       5940 :       m_emitter &lt;&lt; Block;</span>
<span class="lineNum">      54 </span><span class="lineCov">       5940 :       break;</span>
<span class="lineNum">      55 </span>            :     case EmitterStyle::Flow:
<span class="lineNum">      56 </span><span class="lineCov">        399 :       m_emitter &lt;&lt; Flow;</span>
<span class="lineNum">      57 </span><span class="lineCov">        399 :       break;</span>
<span class="lineNum">      58 </span>            :     default:
<span class="lineNum">      59 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">      60 </span>            :   }
<span class="lineNum">      61 </span><span class="lineCov">       6339 :   m_emitter &lt;&lt; BeginSeq;</span>
<span class="lineNum">      62 </span><span class="lineCov">       6339 :   m_stateStack.push(State::WaitingForSequenceEntry);</span>
<a name="63"><span class="lineNum">      63 </span><span class="lineCov">       6339 : }</span></a>
<span class="lineNum">      64 </span>            : 
<span class="lineNum">      65 </span><span class="lineCov">       6339 : void EmitFromEvents::OnSequenceEnd() {</span>
<span class="lineNum">      66 </span><span class="lineCov">       6339 :   m_emitter &lt;&lt; EndSeq;</span>
<span class="lineNum">      67 </span><span class="lineCov">       6339 :   assert(m_stateStack.top() == State::WaitingForSequenceEntry);</span>
<span class="lineNum">      68 </span><span class="lineCov">       6339 :   m_stateStack.pop();</span>
<a name="69"><span class="lineNum">      69 </span><span class="lineCov">       6339 : }</span></a>
<span class="lineNum">      70 </span>            : 
<span class="lineNum">      71 </span><span class="lineCov">      11182 : void EmitFromEvents::OnMapStart(const Mark&amp;, const std::string&amp; tag,</span>
<span class="lineNum">      72 </span>            :                                 anchor_t anchor, EmitterStyle::value style) {
<span class="lineNum">      73 </span><span class="lineCov">      11182 :   BeginNode();</span>
<span class="lineNum">      74 </span><span class="lineCov">      11182 :   EmitProps(tag, anchor);</span>
<span class="lineNum">      75 </span><span class="lineCov">      11182 :   switch (style) {</span>
<span class="lineNum">      76 </span>            :     case EmitterStyle::Block:
<span class="lineNum">      77 </span><span class="lineCov">      10634 :       m_emitter &lt;&lt; Block;</span>
<span class="lineNum">      78 </span><span class="lineCov">      10634 :       break;</span>
<span class="lineNum">      79 </span>            :     case EmitterStyle::Flow:
<span class="lineNum">      80 </span><span class="lineCov">        402 :       m_emitter &lt;&lt; Flow;</span>
<span class="lineNum">      81 </span><span class="lineCov">        402 :       break;</span>
<span class="lineNum">      82 </span>            :     default:
<span class="lineNum">      83 </span><span class="lineCov">        146 :       break;</span>
<span class="lineNum">      84 </span>            :   }
<span class="lineNum">      85 </span><span class="lineCov">      11182 :   m_emitter &lt;&lt; BeginMap;</span>
<span class="lineNum">      86 </span><span class="lineCov">      11182 :   m_stateStack.push(State::WaitingForKey);</span>
<a name="87"><span class="lineNum">      87 </span><span class="lineCov">      11182 : }</span></a>
<span class="lineNum">      88 </span>            : 
<span class="lineNum">      89 </span><span class="lineCov">      11182 : void EmitFromEvents::OnMapEnd() {</span>
<span class="lineNum">      90 </span><span class="lineCov">      11182 :   m_emitter &lt;&lt; EndMap;</span>
<span class="lineNum">      91 </span><span class="lineCov">      11182 :   assert(m_stateStack.top() == State::WaitingForKey);</span>
<span class="lineNum">      92 </span><span class="lineCov">      11182 :   m_stateStack.pop();</span>
<a name="93"><span class="lineNum">      93 </span><span class="lineCov">      11182 : }</span></a>
<span class="lineNum">      94 </span>            : 
<span class="lineNum">      95 </span><span class="lineCov">      54806 : void EmitFromEvents::BeginNode() {</span>
<span class="lineNum">      96 </span><span class="lineCov">      54806 :   if (m_stateStack.empty())</span>
<span class="lineNum">      97 </span><span class="lineCov">        945 :     return;</span>
<span class="lineNum">      98 </span>            : 
<span class="lineNum">      99 </span><span class="lineCov">      53861 :   switch (m_stateStack.top()) {</span>
<span class="lineNum">     100 </span>            :     case State::WaitingForKey:
<span class="lineNum">     101 </span><span class="lineCov">      18256 :       m_emitter &lt;&lt; Key;</span>
<span class="lineNum">     102 </span><span class="lineCov">      18256 :       m_stateStack.top() = State::WaitingForValue;</span>
<span class="lineNum">     103 </span><span class="lineCov">      18256 :       break;</span>
<span class="lineNum">     104 </span>            :     case State::WaitingForValue:
<span class="lineNum">     105 </span><span class="lineCov">      18256 :       m_emitter &lt;&lt; Value;</span>
<span class="lineNum">     106 </span><span class="lineCov">      18256 :       m_stateStack.top() = State::WaitingForKey;</span>
<span class="lineNum">     107 </span><span class="lineCov">      18256 :       break;</span>
<span class="lineNum">     108 </span>            :     default:
<span class="lineNum">     109 </span><span class="lineCov">      17349 :       break;</span>
<span class="lineNum">     110 </span>            :   }
<a name="111"><span class="lineNum">     111 </span>            : }</a>
<span class="lineNum">     112 </span>            : 
<span class="lineNum">     113 </span><span class="lineCov">      52816 : void EmitFromEvents::EmitProps(const std::string&amp; tag, anchor_t anchor) {</span>
<span class="lineNum">     114 </span><span class="lineCov">      52816 :   if (!tag.empty() &amp;&amp; tag != &quot;?&quot;)</span>
<span class="lineNum">     115 </span><span class="lineCov">       3779 :     m_emitter &lt;&lt; VerbatimTag(tag);</span>
<span class="lineNum">     116 </span><span class="lineCov">      52816 :   if (anchor)</span>
<span class="lineNum">     117 </span><span class="lineCov">       1131 :     m_emitter &lt;&lt; Anchor(ToString(anchor));</span>
<span class="lineNum">     118 </span><span class="lineCov">      52816 : }</span>
<span class="lineNum">     119 </span>            : }
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.11</a></td></tr>
  </table>
  <br>

</body>
</html>
